﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace NoteTableUI.Models
{

    public class IdeaDataModel
    {
        public IdeaDataModel()
        {
            Rows = new List<RowModel>();
            Columns = new List<ColumnInIdeaModel>();
            CreateTime = DateTime.Now;
            IsDeleted = false;
        }
        public int IdeaId { get; set; }

        [Required(ErrorMessage = "A name is required!")]
        public string IdeaName { get; set; }

        public string IdeaDescription { get; set; }

        public DateTime CreateTime { get; set; }

        public bool IsDeleted { get; set; }

        public int UserId { get; set; }

        public IList<RowModel> Rows { get; set; }

        public IList<ColumnInIdeaModel> Columns { get; set; }

    }

    public class RowModel
    {
        public RowModel()
        {
            Columns = new List<ColumnInIdeaModel>();
            Values = new List<object>();
            IsDeleted = false;
        }
        public int RowId { get; set; }
        public int IdeaId { get; set; }
        public int Version { get; set; }
        public bool IsDeleted { get; set; }
        public int UserId { get; set; }

        public IList<ColumnInIdeaModel> Columns { get; set; }
        public IList<object> Values { get; set; }
    }

}